package com.feijia.aijingjingus;

import android.content.Context;

import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;

import java.text.SimpleDateFormat;

/**
 * Created by feiga on 2017/8/28.
 */

public class MCVSelectorDecorator  implements DayViewDecorator {

    private final Context context;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    public MCVSelectorDecorator( Context context) {
        this.context =context;
    }
    /**
     * 设置效果
     * @param day {@linkplain CalendarDay} to possibly decorate
     *
     * @return
     */
    @Override
    public boolean shouldDecorate(CalendarDay day) {
        return true;
    }

    /**
     * 具体实现的效果
     * @param view View to decorate
     */
    @Override
    public void decorate(DayViewFacade view) {
        //view.addSpan(new DotSpan(5, color));
        //view.addSpan(new ForegroundColorSpan(Color.WHITE));
        //view.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.mcvselecter));
        view.setSelectionDrawable(context.getResources().getDrawable(R.drawable.mcvselecter));
    }
}
